import java.util.Scanner;

public final class MyUtility {
    private static Scanner in = new Scanner(System.in);

    //    读取一个字符
    public static char readChar() {
        String s=in.nextLine();
        if(s.length()==1)
            return s.charAt(0);
        else
            return 0;
    }
    //    读取一个字符串
    public static String readSting() {
        return in.nextLine();
    }

    //    读取密码
    public static String readCode() {
        String s = MyUtility.readSting();
        if (Code.inspectCode(s)) {
            return s;
        } else {
            System.out.println("密码格式有误，请重新输入");
            return MyUtility.readCode();
        }
    }
    public static void exit(){
        in.close();
    }
}
